﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Entity.ModelConfiguration;
using System.ComponentModel.DataAnnotations;

namespace ERPStore.Exporter.Repositories.Mapping
{
	public class BanishedProductBySourceMap : EntityTypeConfiguration<Datas.BanishedProductBySource>
	{
		public BanishedProductBySourceMap()
		{
			this.HasKey(e => e.Id);
			Property(e => e.Id)
				.IsRequired()
				.HasDatabaseGeneratedOption(System.ComponentModel.DataAnnotations.Schema.DatabaseGeneratedOption.Identity);
			Property(e => e.ProductId)
				.IsRequired();
			Property(e => e.SourceId)
				.IsRequired()
				.HasMaxLength(50);

			Property(e => e.ReleaseDate)
				.IsOptional();

			ToTable("ERPStore_BanishedProductBySource");
		}
	}
}
